float L; //length between mouse positions float pS; //L divided by something to make it into a line width int S; //S rounded to an integer so it can be used as a stroke float P; float M; float counter=0; float FR = 80.0; float timeSegment; void setup(){ size(800,800); background(200); frameRate(FR); timeSegment = 1.0/FR; } void draw() { counter = counter + timeSegment; P = pmouseX-mouseX; if (P<0){ P = -P;} M = pmouseY-mouseY; if (M<0){M = -M;} L = P-M; if (L<0){L = -L;} pS = L*2; // if (pS<0){pS = -pS;} S = int(pS); if (S<1){S=1;} println(counter); //println(timeSegment); //println(FR); if (mousePressed == true) { stroke(300); strokeWeight(S); line(pmouseX, pmouseY, mouseX, mouseY); } }